package com.practicaljava.lesson27;

import java.util.ArrayList;


public class StockQuoteGenerator {
	private String price = null;
	private ArrayList<String> nasdaqSymbols = new ArrayList<String>();
	
	public StockQuoteGenerator(){
		nasdaqSymbols.add("AAPL");
		nasdaqSymbols.add("MSFT");
		nasdaqSymbols.add("YHOO");
		nasdaqSymbols.add("AMZN");
		nasdaqSymbols.add("ORCL");
	}
	
	public String getQuote(String symbol){
		if(nasdaqSymbols.indexOf(symbol.toUpperCase())!=-1){
			price = (new Double(Math.random()*100).toString());
		}
		return price;
	}

}
